<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>考察行程列表 - 领导日程说明系统</title>
    <meta th:replace="~{head/head_include ::  title}"/>
    <link rel="stylesheet" th:href="@{/head_res/bootstrapvalidator/css/form-validation.css}">
    <script type="text/javascript" th:src="@{/head_res/bootstrapvalidator/js/form-validation.js}"></script>
    <script type="text/javascript" charset="utf-8" th:src="@{/head_res/ueditor/ueditor.config.js}"></script>
    <script type="text/javascript" charset="utf-8" th:src="@{/head_res/ueditor/ueditor.all.min.js}"> </script>
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里更新的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" th:src="@{/head_res/ueditor/lang/zh-cn/zh-cn.js}"></script>
    <script type="text/javascript" th:inline="javascript">
        $(function()
        {
            $("#form").FormValidation({
                fields:
                    {
                        /* 用户名 */
                        name:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '名称不能为空'
                                    },
                                    stringLength: {
                                        min: 4,
                                        max:40,
                                        message: '名称的长度为在4位与40位之间'
                                    }
                                }
                            },
                        investigateStartDate:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '开始日期不能为空'
                                    }
                                }
                            },
                        investigateEndDate:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '结束日期不能为空'
                                    }
                                }
                            },
                    }
            });

            var ue = UE.getEditor('editor');
            var content = [[${one?.content}]];
            /* 百度编辑器提供的方法 */
            ue.addListener("ready", function () {
                /* 为百度编辑器赋值 */
                ue.setContent(content);
            });
        });
    </script>
</head>
<body>
<meta th:replace="~{head/head_include ::  header}"/>
<!-- 网页的主体 -->
<div class="container">
    <div class="col-md-8 col-sm-10">
        <form id="form" class="form-horizontal" method="post"
              th:action="@{/head/users/investigateUpdateSubmit}">
            <input type="hidden" name="entity.id" th:value="${one.id}">
            <input type="hidden" name="operType" th:value="${paramQuery.operType}">

            <h2 class="col-sm-10 col-sm-offset-1 form-signin-heading text-center">更新考察行程</h2>
            <div class="form-group">
                <label for="name" class="col-sm-3 control-label">名称</label>
                <div class="col-sm-8">
                    <input type="text" id="name" name="entity.name" class="form-control"
                           th:value="${one.name}" placeholder="名称">
                </div>
            </div>
            <div class="form-group">
                <label for="name" class="col-sm-3 control-label">领导</label>
                <div class="col-sm-8">
                    <select id="leaderId" name="entity.leaderId" class="form-control">
                        <th:block th:each="dataTemp : ${leaderDataList}">
                            <option th:selected="${one.leaderId == dataTemp.id}" th:value="${dataTemp.id}" th:text="${dataTemp.name}"/>
                        </th:block>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="name" class="col-sm-3 control-label">考察人员</label>
                <div class="col-sm-8">
                    <select id="staffTypeKaocha" name="entity.staffTypeKaocha" class="form-control" multiple>
                        <th:block th:each="dataTemp : ${usersDataList}">
                            <option th:selected="${one.staffTypeKaocha == dataTemp.id}" th:value="${dataTemp.id}" th:text="${dataTemp.name}"/>
                        </th:block>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="name" class="col-sm-3 control-label">陪同人员</label>
                <div class="col-sm-8">
                    <select id="staffTypePeitong" name="entity.staffTypePeitong" class="form-control" multiple>
                        <th:block th:each="dataTemp : ${usersDataList}">
                            <option th:selected="${one.staffTypePeitong == dataTemp.id}" th:value="${dataTemp.id}" th:text="${dataTemp.name}"/>
                        </th:block>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="pubTimeStr" class="col-sm-2 control-label"></label>
                <a class="btn btn-primary" data-toggle="collapse" href="#staffTypeKaochaList" role="button" aria-expanded="true" aria-controls="staffTypeKaochaList">
                    考察人员列表
                </a>
                <a class="btn btn-primary" data-toggle="collapse" href="#staffTypePeitongList" role="button" aria-expanded="true" aria-controls="staffTypePeitongList">
                    陪同人员列表
                </a>
                <!-- 答案选项列表 -->
                <div class="row show" id="staffTypeKaochaList">
                    <div class="col-md-11 col-sm-offset-1">
                        <h4 class="sub-header">考察人员列表</h4>
                        <div class="table-responsive mt-2">
                            <table class="table table-striped table-hover">
                                <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>人员</th>
                                    <th>创建时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <th:block th:each="oneTemp : ${one.staffTypeKaochaList }">
                                    <tr>
                                        <td th:text="${oneTemp.id }"></td>
                                        <td th:text="${oneTemp?.usersDescObj?.name }">/td>
                                        <td th:text="${#dates.format(oneTemp.updateTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                                    </tr>
                                </th:block>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="row show" id="staffTypePeitongList">
                    <div class="col-md-11 col-sm-offset-1">
                        <h4 class="sub-header">陪同人员列表</h4>
                        <div class="table-responsive mt-2">
                            <table class="table table-striped table-hover">
                                <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>人员</th>
                                    <th>创建时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <th:block th:each="oneTemp : ${one.staffTypePeitongList }">
                                    <tr>
                                        <td th:text="${oneTemp.id }"></td>
                                        <td th:text="${oneTemp?.usersDescObj?.name }">/td>
                                        <td th:text="${#dates.format(oneTemp.updateTime,'yyyy-MM-dd HH:mm:ss')}"></td>
                                    </tr>
                                </th:block>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label for="proccedEndTime" class="col-sm-3 control-label">处理期限</label>
                <div class="col-sm-8">
                    <input type="text" id="proccedEndTime" name="proccedEndTime" th:value="${#dates.format(one.proccedEndTime,'yyyy-MM-dd HH:mm:ss')}" readonly="true"
                           class="form-control mr-sm-2"
                           onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                </div>
            </div>
            <div class="form-group">
                <label for="status" class="col-sm-2 control-label">状态:</label>
            </div>
            <div class="form-group">
                <div class="col-sm-8 form-check form-check-inline">
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <!-- 拆分,按照-拆分,取最后一个 -->
                    <input type="radio" id="status0" name="entity.status" class="form-check-input" value="0" th:checked="${one.status == '0'}">
                    <label for="status0" class="form-check-label">录入</label>
                    &nbsp;&nbsp;
                    <!-- 拆分,按照-拆分,取最后一个 -->
                    <input type="radio" id="status1" name="entity.status" class="form-check-input" value="1" th:checked="${one.status == '1'}">
                    <label for="status1" class="form-check-label">发布</label>
                    &nbsp;&nbsp;
                </div>
            </div>
            <div class="form-group">
                <label for="editor" class="col-sm-2 control-label">内容:</label>
                <div class="col-sm-8">
                    <script id="editor" name="entity.content" type="text/plain" style="width:800px;height:300px;" th:text="${one.content}"></script>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-2">
                    <button class="btn btn-md btn-primary" type="submit">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<meta th:replace="~{head/head_include ::  footer}"/>
</body>
</html>